package game;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;


/**
 * LUMM2 Game Template Midlet Class
 * 
 * @author IMS
 * @since 18.02.2009
 */

public class LUMM2_Midlet extends MIDlet {
	
	public static LUMM2_Canvas pc;
	public static RMSHighScore rms;

	/** application state */
	private static boolean appStarted;

	/**
	 * LUMM2_Midlet constructor
	 */
	public LUMM2_Midlet() {
		System.gc();
		appStarted = false;
	}

	/**
	 * start midlet
	 */
	public void startApp() {
		if (!appStarted) {
			rms = new RMSHighScore();
			appStarted = true;
			Display display = Display.getDisplay(this);
			pc = new LUMM2_Canvas(this);
			display.setCurrent(pc);
		}
	}

	/**
	 * pause midlet
	 */
	public void pauseApp() {
		// TODO
	}

	/**
	 * destroy midlet
	 * 
	 * @param unconditional
	 */
	public void destroyApp(boolean unconditional) {
		rms.closeRecordStore(unconditional);
		this.notifyDestroyed();
	}
}
